\section{th\_\-info Struct Reference}
\label{structth__info}\index{th\_\-info@{th\_\-info}}
Theora bitstream information.  


{\tt \#include $<$codec.h$>$}

\subsection*{Data Fields}
\begin{CompactItemize}
\item 
ogg\_\-uint32\_\-t {\bf frame\_\-width}
\begin{CompactList}\small\item\em The encoded frame width. \item\end{CompactList}\item 
ogg\_\-uint32\_\-t {\bf frame\_\-height}
\begin{CompactList}\small\item\em The encoded frame height. \item\end{CompactList}\item 
ogg\_\-uint32\_\-t {\bf pic\_\-width}
\begin{CompactList}\small\item\em The displayed picture width. \item\end{CompactList}\item 
ogg\_\-uint32\_\-t {\bf pic\_\-height}
\begin{CompactList}\small\item\em The displayed picture height. \item\end{CompactList}\item 
ogg\_\-uint32\_\-t {\bf pic\_\-x}
\begin{CompactList}\small\item\em The X offset of the displayed picture. \item\end{CompactList}\item 
ogg\_\-uint32\_\-t {\bf pic\_\-y}
\begin{CompactList}\small\item\em The Y offset of the displayed picture. \item\end{CompactList}\item 
{\bf th\_\-colorspace} {\bf colorspace}
\begin{CompactList}\small\item\em The color space. \item\end{CompactList}\item 
{\bf th\_\-pixel\_\-fmt} {\bf pixel\_\-fmt}
\begin{CompactList}\small\item\em The pixel format. \item\end{CompactList}\item 
int {\bf target\_\-bitrate}
\begin{CompactList}\small\item\em The target bit-rate in bits per second. \item\end{CompactList}\item 
int {\bf quality}
\begin{CompactList}\small\item\em The target quality level. \item\end{CompactList}\item 
int {\bf keyframe\_\-granule\_\-shift}
\begin{CompactList}\small\item\em The amount to shift to extract the last keyframe number from the granule position. \item\end{CompactList}\end{CompactItemize}
\begin{Indent}{\bf Theora version}\par
{\em Bitstream version information.}\begin{CompactItemize}
\item 
unsigned char {\bf version\_\-major}
\item 
unsigned char {\bf version\_\-minor}
\item 
unsigned char {\bf version\_\-subminor}
\end{CompactItemize}
\end{Indent}
\begin{Indent}{\bf Frame rate}\par
{\em The frame rate, as a fraction.

If either is 0, the frame rate is undefined. }\begin{CompactItemize}
\item 
ogg\_\-uint32\_\-t {\bf fps\_\-numerator}
\item 
ogg\_\-uint32\_\-t {\bf fps\_\-denominator}
\end{CompactItemize}
\end{Indent}
\begin{Indent}{\bf Aspect ratio}\par
{\em The aspect ratio of the pixels.

If either value is zero, the aspect ratio is undefined. If not specified by any external means, 1:1 should be assumed. The aspect ratio of the full picture can be computed as 

\begin{Code}\begin{verbatim}  aspect_numerator*pic_width/(aspect_denominator*pic_height).
\end{verbatim}
\end{Code}

 }\begin{CompactItemize}
\item 
ogg\_\-uint32\_\-t {\bf aspect\_\-numerator}
\item 
ogg\_\-uint32\_\-t {\bf aspect\_\-denominator}
\end{CompactItemize}
\end{Indent}


\subsection{Detailed Description}
Theora bitstream information. 

This contains the basic playback parameters for a stream, and corresponds to the initial 'info' header packet. To initialize an encoder, the application fills in this structure and passes it to \doxyref{th\_\-encode\_\-alloc()}{p.}{group__encfuncs_ga91e47bc9dd5f6ee52045bd7b815e5a7}. A default encoding mode is chosen based on the values of the \doxyref{quality}{p.}{structth__info_a4cdcf96cb46b256821993e9a830ee02} and \doxyref{target\_\-bitrate}{p.}{structth__info_1d9c8d768a4ae623269f5bd8f6f7a015} fields. On decode, it is filled in by \doxyref{th\_\-decode\_\-headerin()}{p.}{group__decfuncs_g006d01d36fbe64768c571e6a12b7fc50}, and then passed to \doxyref{th\_\-decode\_\-alloc()}{p.}{group__decfuncs_g0ef07a9a97849054aa606c595a2d807e}.

Encoded Theora frames must be a multiple of 16 in size; this is what the \doxyref{frame\_\-width}{p.}{structth__info_6b8087a4d831da53011a43b8d74087a0} and \doxyref{frame\_\-height}{p.}{structth__info_6b1adc3a16a8336a72692b0a5937214c} members represent. To handle arbitrary picture sizes, a crop rectangle is specified in the \doxyref{pic\_\-x}{p.}{structth__info_5b3f834bcf141564e7bb14f49101870f}, \doxyref{pic\_\-y}{p.}{structth__info_8aacc575cab2dfe3735001c2ad32aa14}, \doxyref{pic\_\-width}{p.}{structth__info_5048edf77b141dd3e9a92ca85e317345} and \doxyref{pic\_\-height}{p.}{structth__info_775178474283c5990ba73f9ba7f6b88b} members.

All frame buffers contain pointers to the full, padded frame. However, the current encoder {\em will not\/} reference pixels outside of the cropped picture region, and the application does not need to fill them in. The decoder {\em will\/} allocate storage for a full frame, but the application {\em should not\/} rely on the padding containing sensible data.

It is also generally recommended that the offsets and sizes should still be multiples of 2 to avoid chroma sampling shifts when chroma is sub-sampled. See {\tt the Theora specification}, Section 4.4, for more details.

Frame rate, in frames per second, is stored as a rational fraction, as is the pixel aspect ratio. Note that this refers to the aspect ratio of the individual pixels, not of the overall frame itself. The frame aspect ratio can be computed from pixel aspect ratio using the image dimensions. 

\subsection{Field Documentation}
\index{th\_\-info@{th\_\-info}!version\_\-major@{version\_\-major}}
\index{version\_\-major@{version\_\-major}!th_info@{th\_\-info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned char {\bf th\_\-info::version\_\-major}}\label{structth__info_60b3e2cac006fee0e105a918d6a5a9f9}


\index{th\_\-info@{th\_\-info}!version\_\-minor@{version\_\-minor}}
\index{version\_\-minor@{version\_\-minor}!th_info@{th\_\-info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned char {\bf th\_\-info::version\_\-minor}}\label{structth__info_bb1d4887a8079c6c5aaa6d7229f243d7}


\index{th\_\-info@{th\_\-info}!version\_\-subminor@{version\_\-subminor}}
\index{version\_\-subminor@{version\_\-subminor}!th_info@{th\_\-info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned char {\bf th\_\-info::version\_\-subminor}}\label{structth__info_bfacc79b7cabae12b6ac2484f76602d3}


\index{th\_\-info@{th\_\-info}!frame\_\-width@{frame\_\-width}}
\index{frame\_\-width@{frame\_\-width}!th_info@{th\_\-info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ogg\_\-uint32\_\-t {\bf th\_\-info::frame\_\-width}}\label{structth__info_6b8087a4d831da53011a43b8d74087a0}


The encoded frame width. 

This must be a multiple of 16, and less than 1048576. \index{th\_\-info@{th\_\-info}!frame\_\-height@{frame\_\-height}}
\index{frame\_\-height@{frame\_\-height}!th_info@{th\_\-info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ogg\_\-uint32\_\-t {\bf th\_\-info::frame\_\-height}}\label{structth__info_6b1adc3a16a8336a72692b0a5937214c}


The encoded frame height. 

This must be a multiple of 16, and less than 1048576. \index{th\_\-info@{th\_\-info}!pic\_\-width@{pic\_\-width}}
\index{pic\_\-width@{pic\_\-width}!th_info@{th\_\-info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ogg\_\-uint32\_\-t {\bf th\_\-info::pic\_\-width}}\label{structth__info_5048edf77b141dd3e9a92ca85e317345}


The displayed picture width. 

This must be no larger than width. \index{th\_\-info@{th\_\-info}!pic\_\-height@{pic\_\-height}}
\index{pic\_\-height@{pic\_\-height}!th_info@{th\_\-info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ogg\_\-uint32\_\-t {\bf th\_\-info::pic\_\-height}}\label{structth__info_775178474283c5990ba73f9ba7f6b88b}


The displayed picture height. 

This must be no larger than height. \index{th\_\-info@{th\_\-info}!pic\_\-x@{pic\_\-x}}
\index{pic\_\-x@{pic\_\-x}!th_info@{th\_\-info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ogg\_\-uint32\_\-t {\bf th\_\-info::pic\_\-x}}\label{structth__info_5b3f834bcf141564e7bb14f49101870f}


The X offset of the displayed picture. 

This must be no larger than \doxyref{frame\_\-width}{p.}{structth__info_6b8087a4d831da53011a43b8d74087a0}-\doxyref{pic\_\-width}{p.}{structth__info_5048edf77b141dd3e9a92ca85e317345} or 255, whichever is smaller. \index{th\_\-info@{th\_\-info}!pic\_\-y@{pic\_\-y}}
\index{pic\_\-y@{pic\_\-y}!th_info@{th\_\-info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ogg\_\-uint32\_\-t {\bf th\_\-info::pic\_\-y}}\label{structth__info_8aacc575cab2dfe3735001c2ad32aa14}


The Y offset of the displayed picture. 

This must be no larger than \doxyref{frame\_\-height}{p.}{structth__info_6b1adc3a16a8336a72692b0a5937214c}-\doxyref{pic\_\-height}{p.}{structth__info_775178474283c5990ba73f9ba7f6b88b}, and \doxyref{frame\_\-height}{p.}{structth__info_6b1adc3a16a8336a72692b0a5937214c}-\doxyref{pic\_\-height}{p.}{structth__info_775178474283c5990ba73f9ba7f6b88b}-\doxyref{pic\_\-y}{p.}{structth__info_8aacc575cab2dfe3735001c2ad32aa14} must be no larger than 255. This slightly funny restriction is due to the fact that the offset is specified from the top of the image for consistency with the standard graphics left-handed coordinate system used throughout this API, while it is stored in the encoded stream as an offset from the bottom. \index{th\_\-info@{th\_\-info}!fps\_\-numerator@{fps\_\-numerator}}
\index{fps\_\-numerator@{fps\_\-numerator}!th_info@{th\_\-info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ogg\_\-uint32\_\-t {\bf th\_\-info::fps\_\-numerator}}\label{structth__info_20606e61676f585a7e59cfc96de190a5}


\index{th\_\-info@{th\_\-info}!fps\_\-denominator@{fps\_\-denominator}}
\index{fps\_\-denominator@{fps\_\-denominator}!th_info@{th\_\-info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ogg\_\-uint32\_\-t {\bf th\_\-info::fps\_\-denominator}}\label{structth__info_a619408f70c03935529f1d3eda7a3ec2}


\index{th\_\-info@{th\_\-info}!aspect\_\-numerator@{aspect\_\-numerator}}
\index{aspect\_\-numerator@{aspect\_\-numerator}!th_info@{th\_\-info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ogg\_\-uint32\_\-t {\bf th\_\-info::aspect\_\-numerator}}\label{structth__info_5be65dac9f75e37864cf73dd543570cd}


\index{th\_\-info@{th\_\-info}!aspect\_\-denominator@{aspect\_\-denominator}}
\index{aspect\_\-denominator@{aspect\_\-denominator}!th_info@{th\_\-info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ogg\_\-uint32\_\-t {\bf th\_\-info::aspect\_\-denominator}}\label{structth__info_04c0bd477222d747a76085d8720322e2}


\index{th\_\-info@{th\_\-info}!colorspace@{colorspace}}
\index{colorspace@{colorspace}!th_info@{th\_\-info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf th\_\-colorspace} {\bf th\_\-info::colorspace}}\label{structth__info_8c7828cd0e023e9d21108160d53659a6}


The color space. 

\index{th\_\-info@{th\_\-info}!pixel\_\-fmt@{pixel\_\-fmt}}
\index{pixel\_\-fmt@{pixel\_\-fmt}!th_info@{th\_\-info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf th\_\-pixel\_\-fmt} {\bf th\_\-info::pixel\_\-fmt}}\label{structth__info_2301388ef3755c41ab12fd144c1fc54e}


The pixel format. 

\index{th\_\-info@{th\_\-info}!target\_\-bitrate@{target\_\-bitrate}}
\index{target\_\-bitrate@{target\_\-bitrate}!th_info@{th\_\-info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int {\bf th\_\-info::target\_\-bitrate}}\label{structth__info_1d9c8d768a4ae623269f5bd8f6f7a015}


The target bit-rate in bits per second. 

If initializing an encoder with this struct, set this field to a non-zero value to activate CBR encoding by default. \index{th\_\-info@{th\_\-info}!quality@{quality}}
\index{quality@{quality}!th_info@{th\_\-info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int {\bf th\_\-info::quality}}\label{structth__info_a4cdcf96cb46b256821993e9a830ee02}


The target quality level. 

Valid values range from 0 to 63, inclusive, with higher values giving higher quality. If initializing an encoder with this struct, and \doxyref{target\_\-bitrate}{p.}{structth__info_1d9c8d768a4ae623269f5bd8f6f7a015} is set to zero, VBR encoding at this quality will be activated by default. \index{th\_\-info@{th\_\-info}!keyframe\_\-granule\_\-shift@{keyframe\_\-granule\_\-shift}}
\index{keyframe\_\-granule\_\-shift@{keyframe\_\-granule\_\-shift}!th_info@{th\_\-info}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int {\bf th\_\-info::keyframe\_\-granule\_\-shift}}\label{structth__info_693ca4ab11fbc0c3f32594b4bb8766ed}


The amount to shift to extract the last keyframe number from the granule position. 

This can be at most 31. \doxyref{th\_\-info\_\-init()}{p.}{group__basefuncs_g430d9c605816a6ca0bdce3a0b965b926} will set this to a default value (currently {\tt 6}, which is good for streaming applications), but you can set it to 0 to make every frame a keyframe. The maximum distance between key frames is {\tt 1$<$$<$\doxyref{keyframe\_\-granule\_\-shift}{p.}{structth__info_693ca4ab11fbc0c3f32594b4bb8766ed}}. The keyframe frequency can be more finely controlled with \doxyref{TH\_\-ENCCTL\_\-SET\_\-KEYFRAME\_\-FREQUENCY\_\-FORCE}{p.}{theoraenc_8h_27e755e15b4b5604c54974b304037a49}, which can also be adjusted during encoding (for example, to force the next frame to be a keyframe), but it cannot be set larger than the amount permitted by this field after the headers have been output. 

The documentation for this struct was generated from the following file:\begin{CompactItemize}
\item 
{\bf codec.h}\end{CompactItemize}
